package com.example.example04;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class RawLogPartition extends Partitioner<Text, Text> {

  @Override
  public int getPartition(Text key, Text val, int numPartitions) {
    int partition=0;
    final String appkey = key.toString();
    if(appkey.equals("kar")){
      partition=1;
    }else if(appkey.equals("pandora")){
      partition=2;
    }else{
      partition=0;
    }
    return partition;
  }
}